package com.yc.jiushujie.jsj_order.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yc.jiushujie.entity.JsjCategory;
import com.yc.jiushujie.entity.JsjSearch;
import com.yc.jiushujie.jsj_order.mapper.JsjCategoryMapper;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 无罪
 * @since 2022-08-03
 */
@RestController
@RequestMapping("/jiushujie/jsjCategory")
public class JsjCategoryController {
    @Resource
    JsjCategoryMapper jsjCategoryMapper;
    @RequestMapping("queryCategory")
    public List<JsjCategory> queryCategory(){
        IPage<JsjCategory> page=new Page<>(1,50);
        page.orders().add(OrderItem.desc("id"));
        page=jsjCategoryMapper.selectPage(page,null);
        return page.getRecords();

    }

}

